local skill = fk.CreateSkill {
  name = "hanqing__anjian__foresight_skill",
}

Fk:loadTranslationTable{
  ["hanqing__anjian__foresight_skill"] = "洞烛先机",
}

skill:addEffect("cardskill", {
  mute = true,
  prompt = "#foresight_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = Util.CanUseToSelf,
  on_effect = function(self, room, effect)
    local player = effect.from
    local to = effect.to
    if not (effect.extra_data and effect.extra_data.hanqing__anjian) then
      room:askToGuanxing(to, {cards = room:getNCards(2)})
    end
    if player:usedSkillTimes("hanqing__anjian", Player.HistoryGame) <= player:usedSkillTimes("hanqing__xiaojing", Player.HistoryGame) then
      room:drawCards(to, 2, "foresight_skill")
    end
  end,
})

return skill
